<template>
  <div>
    <div class="p wrap">
      <span>
        <span>首页</span>
        <i>/</i>
        <span>个人中心</span>
        <i>/</i>
        <span>个人信息</span>
      </span>
    </div>
    <div class="account wrap">
      <div class="l">
        <div class="l_top">
          <img :src="userInfo.headImg" alt="" width="100px" height="100px" />
        </div>
        <p class="l_name">{{ userInfo.nickName }}</p>
        <h3>交易管理</h3>
        <ul class="l_Ber">
          <li class="active">帐号管理</li>
          <li>我的订单</li>
          <li @click="ToShopping">购物车</li>
          <li>消息通知</li>
          <li>积分明细</li>
          <li>积分攻略</li>
        </ul>
      </div>
      <div class="r">
        <div class="dl">退出登录</div>
        <div class="jc"> 解除绑定</div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  data() {
    return {};
  },
  computed: {
    ...mapState({
      userInfo: (state) => state.userInfo.userInfo,
    }),
  },
  methods:{
      ToShopping(){
          this.$router.push("/user/shopping")
      }
  }
};
</script>
 
<style lang = "less" scoped>
.p {
  padding: 15px 0;
  i {
    margin: 0 10px;
  }
}
.account {
  padding: 28px 0 48px;
  border-top: 1px solid #ccc;
  display: flex;
  .l {
    background-color: rgb(231, 231, 231);
    font-size: 18px;
    width: 200px;
    min-height: 720px;
    margin-right: 60px;
    cursor: pointer;

    /* 个人头像 */
    .l_top {
      text-align: center;
      margin: 30px auto 15px;
    }
    /* 名字 */
    .l_name {
      text-align: center;
      margin-bottom: 40px;
    }
    h3 {
      font-weight: 800;
      color: #000;
      margin-left: 20px;
      padding-bottom: 20px;
    }
    ul {
      margin-left: 20px;
      li {
        margin-bottom: 17px;
      }
    }
  }
}
.active {
  border-left: 2px solid #0a328e;
  padding-left: 10px;
  color: #0a328e;
}
.r{
    .dl,.jc{
        width: 100px;
        height: 40px;
        background-color: #0a328e;
        color: #fff;
        border-radius: 5px;
        text-align: center;
        line-height: 40px;
        margin-bottom: 15px;
    }
}
</style>